package com.lry.basic.algorithm.loadbanlance;

public class Server {

    private String ip;
    private int callOK;
    private int callFail;
    private int weight;
    private double longestResponseTime;
    private double shortestResponseTime;
    private double averageResponseTime;
    private int callNum;//被调用次数


    public Server(){}
    public Server(String ip){
        this.ip = ip;
    }
    public Server(String ip,int weight){
        this.ip = ip;
        this.weight = weight;
    }
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getCallNum() {
        return callNum;
    }

    public void setCallNum(int callNum) {
        this.callNum = callNum;
    }

    public int getCallOK() {
        return callOK;
    }

    public void setCallOK(int callOK) {
        this.callOK = callOK;
    }

    public int getCallFail() {
        return callFail;
    }

    public void setCallFail(int callFail) {
        this.callFail = callFail;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public double getLongestResponseTime() {
        return longestResponseTime;
    }

    public void setLongestResponseTime(double longestResponseTime) {
        this.longestResponseTime = longestResponseTime;
    }

    public double getShortestResponseTime() {
        return shortestResponseTime;
    }

    public void setShortestResponseTime(double shortestResponseTime) {
        this.shortestResponseTime = shortestResponseTime;
    }

    public double getAverageResponseTime() {
        return averageResponseTime;
    }

    public void setAverageResponseTime(double averageResponseTime) {
        this.averageResponseTime = averageResponseTime;
    }

    @Override
    public String toString() {
        return "Server{" +
                "ip='" + ip + '\'' +
                ", weight=" + weight +
                ", callNum=" + callNum +
                ", callOK=" + callOK +
                ", callFail=" + callFail +
                ", longestResponseTime=" + longestResponseTime +
                ", shortestResponseTime=" + shortestResponseTime +
                ", averageResponseTime=" + averageResponseTime +
                '}';
    }
}
